/*
 * CartesianCoordinate.cpp
 *
 *  Created on: 04-Sep-2014
 *      Author: ali
 */

#include "Coordinate.h"

Coordinate::Coordinate() :
		m_nXPos(0), m_nYPos(0)
{

}
Coordinate::Coordinate(double x, double y) :
		m_nXPos(x), m_nYPos(y)
{
}

const double Coordinate::GetXPos()
{
	return m_nXPos;
}
const double Coordinate::GetYPos()
{
	return m_nYPos;
}
double Coordinate::GetDistance(Coordinate remoteObject)
{
	return sqrt(
			pow((GetXPos() - remoteObject.GetXPos()), 2)
					+ pow((GetYPos() - remoteObject.GetYPos()), 2));

}
Coordinate::~Coordinate()
{
}

ostream & operator<<(ostream &out, Coordinate& c)
{
	out << "X: " << c.GetXPos() << " Y: " << c.GetYPos() << endl;
	return out;
}
